

    new Vue({
        el:"#app",
        data:{
            account:{
                accountName:"",
                accountPassword:""
            }
        },
        methods:{
            login(){
                //发送ajax请求
                axios.post("/account/login",this.account).then(resp=>{
                    alert(resp.data.message)
                    console.log(resp)
                    if(resp.data.code==200){
                        localStorage.setItem("user",JSON.stringify(resp.data.data))
                        localStorage.setItem("accessToken",resp.headers.accesstoken)
                        location.href="/page/main.html"
                    }else{
                        this.user.accountName=""
                        this.user.accountPassword=""
                    }
                })
            }
        }, created(){

        }
    })

